#/bin/sh

JH=/usr/java/latest/bin

PKG=ru.teleology.cubefs.api.reflection
META_PKG=ru.teleology.cubefs.api.reflection.metadata
MODEL_PKG=ru.teleology.cubefs.api.models

LIST_PKG=ru.teleology.cubefs.api.reflection.list
VALUE_PKG=ru.teleology.cubefs.api.reflection.value
ARRAY_PKG=ru.teleology.cubefs.api.reflection.list.array
NUMBER_PKG=ru.teleology.cubefs.api.reflection.number
METADATA_PKG=ru.teleology.cubefs.api.reflection.metadata


${JH}/javah -classpath ../core-java/build -o loader/natives.h ${PKG}.LibraryLoader

${JH}/javah -classpath ../core-java/build -o native/natives.h \
    ${PKG}.Type \
    ${PKG}.Typed \
    ${PKG}.TypeSystem \
    ${PKG}.CoreFactory \
    ${PKG}.Types \
    ${PKG}.Factory \
    ${PKG}.Operation \
    ${PKG}.Parameter \
    ${LIST_PKG}.List \
    ${LIST_PKG}.ListOfBigInt \
    ${LIST_PKG}.ListOfStrings \
    ${LIST_PKG}.ListOfTyped \
    ${LIST_PKG}.ListOfTypes \
    ${LIST_PKG}.StaticListOfTyped \
    ${ARRAY_PKG}.ArrayBase \
    ${ARRAY_PKG}.ByteArray \
    ${NUMBER_PKG}.BigIntNumber \
    ${NUMBER_PKG}.ByteNumber \
    ${NUMBER_PKG}.DoubleNumber \
    ${NUMBER_PKG}.FloatNumber \
    ${NUMBER_PKG}.IntNumber \
    ${NUMBER_PKG}.Number \
    ${NUMBER_PKG}.ShortNumber \
    ${NUMBER_PKG}.UShortNumber \
    ${VALUE_PKG}.BooleanValue \
    ${VALUE_PKG}.ConstStringValue \
    ${VALUE_PKG}.ConstVoidPtrValue \
    ${VALUE_PKG}.StringRefValue \
    ${VALUE_PKG}.TypedIDValue \
    ${VALUE_PKG}.Value \
    ${VALUE_PKG}.VersionValue \
    ${VALUE_PKG}.VoidPtrValue \
    ${META_PKG}.BitmapField \
    ${META_PKG}.NumberField \
    ${META_PKG}.IDField \
    ${MODEL_PKG}.Page \
    ${MODEL_PKG}.InputStreamAdaptor \
    ${MODEL_PKG}.Container \
    ${MODEL_PKG}.OutputStreamAdaptor \
    ${MODEL_PKG}.AbstractJavaLogHandler \
    ${MODEL_PKG}.Iterator \
    ${MODEL_PKG}.Map \
    ${METADATA_PKG}.MetadataGroup



#rm -rf dist
#mkdir dist

make -C build
#cp native/build/*.so dist

#${JH}/jar -cf dist/cubefs-core.jar -C bin .


